package com.tangsw.springbootdemo.model.enums;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 续保状态 .
 */
public enum RenewalStatusEnum {
  FAILED("续保失败."),
  FAILED_TO_LOCAL("续保失败,已读取店内车辆信息,其他请自行完善."),
  SUCCESS("续保成功."),
  SUCCESS_TO_LOCAL("未取到最新到期时间，已读取店内数据."),
  DRIVING("续保失败,只取到行驶本."),
  PENDING("新增,待批续.");

  private final String value;

  RenewalStatusEnum(String value) {
    this.value = value;
  }

  @JsonValue
  public String value() {
    return value;
  }

  /**
   * 是否续保成功.
   */
  public boolean isSuccess() {
    return this.compareTo(SUCCESS) == 0;
  }
}
